import requests
import pytest
import openpyxl
import json
import html
import allure
import os
@allure.feature("地址")
@allure.title("设置默认地址成功")
def test_edit_set(edit_id, h5login):
    url = "http://192.168.10.142:8081/api/front/address/default/set"
    edit_set = {
        "id": edit_id
    }
    resource = requests.post(url=url, json=edit_set, headers={"Authori-Zation": f"{h5login}"})
    resource.raise_for_status()
    print(resource.json())

@allure.feature("地址")
@allure.title("查看默认地址成功")
def test_edit_default(edit_id, h5login):
    url = "http://192.168.10.142:8081/api/front/address/default"
    resource = requests.get(url=url, headers={"Authori-Zation": f"{h5login}"})
    resource.raise_for_status()
    print(resource.json())

@allure.feature("地址")
@allure.title("删除地址成功")
def test_edit_del(edit_id, h5login):
    url = "http://192.168.10.142:8081/api/front/address/del"
    DelEdit = {
        "id": edit_id
    }
    resource2 = requests.post(url=url, json=DelEdit, headers={"Authori-Zation": f"{h5login}"})
    resource2.raise_for_status()
    print(resource2.json())
